<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../style.css" type="text/css" media="screen">
<link rel="stylesheet" href="../../print.css" type="text/css" media="print">
<meta content="locationQueryDatabase,tabinda.as3steer.locationQueryDatabase,bincount,bins,divx,originx,other,sizex,getAllClientObjectsInLocalityClipped,getAllObjects,getAllObjectsInLocality,getAllOutsideObjects,getBinClientObjectList,getMostPopulatedBin,getMostPopulatedBinCenter,lqAddToBin,lqBinCoordsToBinIndex,lqBinForLocation,lqFindNearestNeighborWithinRadius,lqRemoveAllObjects,lqRemoveAllObjectsInBin,lqRemoveFromBin,lqUpdateForNewLocation" name="keywords">
<title>tabinda.as3steer.locationQueryDatabase</title>
</head>
<body>
<script type="text/javascript" language="javascript" src="../../asdoc.js"></script><script type="text/javascript" language="javascript" src="../../cookies.js"></script><script type="text/javascript" language="javascript">
<!--
				asdocTitle = 'locationQueryDatabase - API Documentation';
				var baseRef = '../../';
				window.onload = configPage;
			--></script>
<table style="display:none" id="titleTable" cellspacing="0" cellpadding="0" class="titleTable">
<tr>
<td align="left" class="titleTableTitle">AS3Steer - Pure ActionScript 3 Port</td><td align="right" class="titleTableTopNav"><a onclick="loadClassListFrame('../../all-classes.html')" href="../../package-summary.html">All&nbsp;Packages</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../all-classes.html')" href="../../class-summary.html">All&nbsp;Classes</a>&nbsp;|&nbsp;<a onclick="loadClassListFrame('../../index-list.html')" href="../../all-index-A.html">Index</a>&nbsp;|&nbsp;<a href="../../index.html?tabinda/as3steer/locationQueryDatabase.html&amp;tabinda/as3steer/class-list.html" id="framesLink1">Frames</a><a onclick="parent.location=document.location" href="" style="display:none" id="noFramesLink1">No&nbsp;Frames</a></td><td rowspan="3" align="right" class="titleTableLogo"><img alt="Adobe Logo" title="Adobe Logo" class="logoImage" src="../../images/logo.jpg"></td>
</tr>
<tr class="titleTableRow2">
<td align="left" id="subTitle" class="titleTableSubTitle">Class&nbsp;locationQueryDatabase</td><td align="right" id="subNav" class="titleTableSubNav"><a href="#propertySummary">Properties</a>&nbsp;| <a href="#methodSummary">Methods</a></td>
</tr>
<tr class="titleTableRow3">
<td colspan="2">&nbsp;</td>
</tr>
</table>
<script type="text/javascript" language="javascript">
<!--
if (!isEclipse() || window.name != ECLIPSE_FRAME_NAME) {titleBar_setSubTitle("Class locationQueryDatabase"); titleBar_setSubNav(false,true,false,false,false,false,true,false,false,false,false,false,false,false);}
--></script>
<div class="MainContent">
<table cellspacing="0" cellpadding="0" class="classHeaderTable">
<tr>
<td class="classHeaderTableLabel">Package</td><td><a onclick="javascript:loadClassListFrame('class-list.html')" href="package-detail.html">tabinda.as3steer</a></td>
</tr>
<tr>
<td class="classHeaderTableLabel">Class</td><td class="classSignature">public class locationQueryDatabase</td>
</tr>
</table>
<p></p> This utility is a spatial database which stores objects each of
    which is associated with a 3d point (a location in a 3d space).
    The points serve as the "search key" for the associated object.
    It is intended to efficiently answer "sphere inclusion" queries,
    also known as range queries: basically questions like:

    <p/>  Which objects are within a radius R of the location L?

    <p/>In this context, "efficiently" means significantly faster than the
    naive, brute force O(n) testing of all known points.  Additionally
    it is assumed that the objects move along unpredictable paths, so
    that extensive preprocessing (for example, constructing a Delaunay
    triangulation of the point set) may not be practical.

    <p/>The implementation is a "bin lattice": a 3d rectangular array of
    brick-shaped (rectangular parallelepipeds) regions of space.  Each
    region is represented by a pointer to a (possibly empty) doubly-
    linked list of objects.  All of these sub-bricks are the same
    size.  All bricks are aligned with the global coordinate axes.

    <p/>Terminology used here: the region of space associated with a bin
    is called a sub-brick.  The collection of all sub-bricks is called
    the super-brick.  The super-brick should be specified to surround
    the region of space in which (almost) all the key-points will
    exist.  If key-points move outside the super-brick everything will
    continue to work, but without the speed advantage provided by the
    spatial subdivision.  For more details about how to specify the
    super-brick's position, size and subdivisions see lqCreateDatabase
    below.

    <p/>Overview of usage: an application using this facility would first
    create a database with lqCreateDatabase.  For each client object
    the application wants to put in the database it creates a
    lqClientProxy and initializes it with lqInitClientProxy.  When a
    client object moves, the application calls lqUpdateForNewLocation.
    To perform a query lqMapOverAllObjectsInLocality is passed an
    application-supplied call-back function to be applied to all
    client objects in the locality.  See lqCallBackFunction below for
    more detail.  The lqFindNearestNeighborWithinRadius function can
    be used to find a single nearest neighbor using the database.

    <p/>Note that "locality query" is also known as neighborhood query,
    neighborhood search, near neighbor search, and range query.  For
    additional information on this and related topics see:
    http://www.red3d.com/cwr/boids/ips.html

    <p/>For some description and illustrations of this database in use,
    see this paper: http://www.red3d.com/cwr/papers/2000/pip.html
 <p></p>
<br>
<hr>
</div>
<a name="propertySummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Properties</div>
<table id="summaryTableProperty" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Property</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#bincount">bincount</a> : int<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#bins">bins</a> : Array<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#divx">divx</a> : int<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#originx">originx</a> : Number<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#other">other</a> : <a href="../as3steer/lqBin.html">lqBin</a>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol"><a class="signatureLink" href="#sizex">sizex</a> : Number<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
</table>
</div>
<a name="methodSummary"></a>
<div class="summarySection">
<div class="summaryTableTitle">Public Methods</div>
<table id="summaryTableMethod" class="summaryTable " cellpadding="3" cellspacing="0">
<tr>
<th>&nbsp;</th><th colspan="2">Method</th><th class="summaryTableOwnerCol">Defined&nbsp;by</th>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#locationQueryDatabase()">locationQueryDatabase</a>(_originx:Number, _originy:Number, _originz:Number, _sizex:Number, _sizey:Number, _sizez:Number, _divx:int, _divy:int, _divz:int)</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getAllClientObjectsInLocalityClipped()">getAllClientObjectsInLocalityClipped</a>(x:Number, y:Number, z:Number, radius:Number, minBinX:int, minBinY:int, minBinZ:int, maxBinX:int, maxBinY:int, maxBinZ:int):Array</div>
<div class="summaryTableDescription"> This subroutine of lqMapOverAllObjectsInLocality efficiently
   traverses of subset of bins specified by max and min bin
   coordinates.</div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getAllObjects()">getAllObjects</a>():Array</div>
<div class="summaryTableDescription">
    Apply a user-supplied function to all objects in the database,
   regardless of locality (cf lqMapOverAllObjectsInLocality) 
   </div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getAllObjectsInLocality()">getAllObjectsInLocality</a>(x:Number, y:Number, z:Number, radius:Number):Array</div>
<div class="summaryTableDescription">
     Apply an application-specific function to all objects in a certain
     locality.</div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getAllOutsideObjects()">getAllOutsideObjects</a>(x:Number, y:Number, z:Number, radius:Number):Array</div>
<div class="summaryTableDescription">
    If the query region (sphere) extends outside of the "super-brick"
    we need to check for objects in the catch-all "other" bin which
     holds any object which are not inside the regular sub-bricks  
   </div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getBinClientObjectList()">getBinClientObjectList</a>(bin:<a href="lqBin.html">lqBin</a>, x:Number, y:Number, z:Number, radiusSquared:Number):Array</div>
<div class="summaryTableDescription">  Given a bin's list of client proxies, traverse the list and invoke
     the given lqCallBackFunction on each object that falls within the
     search radius.</div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getMostPopulatedBin()">getMostPopulatedBin</a>():<a href="../as3steer/lqBin.html">lqBin</a>
</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#getMostPopulatedBinCenter()">getMostPopulatedBinCenter</a>():<a href="../as3steer/Vector3.html">Vector3</a>
</div>
<div class="summaryTableDescription"></div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#lqAddToBin()">lqAddToBin</a>(clientObject:<a href="lqClientProxy.html">lqClientProxy</a>, bin:<a href="lqBin.html">lqBin</a>):void</div>
<div class="summaryTableDescription"> Adds a given client object to a given bin, linking it into the bin
   
   </div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#lqBinCoordsToBinIndex()">lqBinCoordsToBinIndex</a>(ix:Number, iy:Number, iz:Number):int</div>
<div class="summaryTableDescription">
   Determine index into linear bin array given 3D bin indices 
   </div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#lqBinForLocation()">lqBinForLocation</a>(x:Number, y:Number, z:Number):<a href="../as3steer/lqBin.html">lqBin</a>
</div>
<div class="summaryTableDescription"> Find the bin ID for a location in space.</div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#lqFindNearestNeighborWithinRadius()">lqFindNearestNeighborWithinRadius</a>(x:Number, y:Number, z:Number, radius:Number, ignoreObject:Object):<a href="../as3steer/lqClientProxy.html">lqClientProxy</a>
</div>
<div class="summaryTableDescription">
   Search the database to find the object whose key-point is nearest
          to a given location yet within a given radius.</div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#lqRemoveAllObjects()">lqRemoveAllObjects</a>():void</div>
<div class="summaryTableDescription"> Removes (all proxies for) all objects from all bins
   </div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#lqRemoveAllObjectsInBin()">lqRemoveAllObjectsInBin</a>(bin:<a href="lqBin.html">lqBin</a>):void</div>
<div class="summaryTableDescription">
   internal helper function
   </div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#lqRemoveFromBin()">lqRemoveFromBin</a>(clientObject:<a href="lqClientProxy.html">lqClientProxy</a>):void</div>
<div class="summaryTableDescription"> Removes a given client object from its current bin, unlinking it
    from the bin contents list.</div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
<tr class="">
<td class="summaryTablePaddingCol">&nbsp;</td><td class="summaryTableInheritanceCol">&nbsp;</td><td class="summaryTableSignatureCol">
<div class="summarySignature">
<a class="signatureLink" href="#lqUpdateForNewLocation()">lqUpdateForNewLocation</a>(clientObject:<a href="lqClientProxy.html">lqClientProxy</a>, x:Number, y:Number, z:Number):void</div>
<div class="summaryTableDescription">  Call for each client object every time its location changes.</div>
</td><td class="summaryTableOwnerCol">locationQueryDatabase</td>
</tr>
</table>
</div>
<script type="text/javascript" language="javascript">
<!--
showHideInherited();
--></script>
<div class="MainContent">
<a name="propertyDetail"></a>
<div class="detailSectionHeader">Property detail</div>
<a name="bincount"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">bincount</td><td class="detailHeaderType">property</td>
</tr>
</table>
<div class="detailBody">
<code>public var bincount:int</code>
</div>
<a name="bins"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">bins</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var bins:Array</code>
</div>
<a name="divx"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">divx</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var divx:int</code>
</div>
<a name="originx"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">originx</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var originx:Number</code>
</div>
<a name="other"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">other</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var other:<a href="../as3steer/lqBin.html">lqBin</a></code>
</div>
<a name="sizex"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">sizex</td><td class="detailHeaderType">property</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public var sizex:Number</code>
</div>
<a name="constructorDetail"></a>
<div class="detailSectionHeader">Constructor detail</div>
<a name="locationQueryDatabase()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">locationQueryDatabase</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">constructor</td>
</tr>
</table>
<div class="detailBody">
<code>public function locationQueryDatabase(_originx:Number, _originy:Number, _originz:Number, _sizex:Number, _sizey:Number, _sizez:Number, _divx:int, _divy:int, _divz:int)</code><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">_originx</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">_originy</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">_originz</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">_sizex</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">_sizey</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">_sizez</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">_divx</span>:int</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">_divy</span>:int</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">_divz</span>:int</code></td>
</tr>
</table>
</div>
<a name="methodDetail"></a>
<div class="detailSectionHeader">Method detail</div>
<a name="getAllClientObjectsInLocalityClipped()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getAllClientObjectsInLocalityClipped</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td>
</tr>
</table>
<div class="detailBody">
<code>public function getAllClientObjectsInLocalityClipped(x:Number, y:Number, z:Number, radius:Number, minBinX:int, minBinY:int, minBinZ:int, maxBinX:int, maxBinY:int, maxBinZ:int):Array</code><p> This subroutine of lqMapOverAllObjectsInLocality efficiently
   traverses of subset of bins specified by max and min bin
   coordinates.
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">z</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">radius</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">minBinX</span>:int</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">minBinY</span>:int</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">minBinZ</span>:int</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">maxBinX</span>:int</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">maxBinY</span>:int</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">maxBinZ</span>:int</code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code></td>
</tr>
</table>
</div>
<a name="getAllObjects()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getAllObjects</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getAllObjects():Array</code><p>
    Apply a user-supplied function to all objects in the database,
   regardless of locality (cf lqMapOverAllObjectsInLocality) 
   </p><p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code></td>
</tr>
</table>
</div>
<a name="getAllObjectsInLocality()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getAllObjectsInLocality</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getAllObjectsInLocality(x:Number, y:Number, z:Number, radius:Number):Array</code><p>
     Apply an application-specific function to all objects in a certain
     locality.  The locality is specified as a sphere with a given
     center and radius.  All objects whose location (key-point) is
     within this sphere are identified and the function is applied to
     them.  The application-supplied function takes three arguments:
        <p/>  (1) a voidpointer to an lqClientProxy's "object".
     <p/>  (2) the square of the distance from the center of the search
           locality sphere (x,y,z) to object's key-point.
     <p/>  (3) a voidpointer to the caller-supplied "client query state"
           object -- typically NULL, but can be used to store state
           between calls to the lqCallBackFunction.
        <p/>This routine uses the LQ database to quickly reject any objects in
     bins which do not overlap with the sphere of interest.  Incremental
     calculation of index values is used to efficiently traverse the
     bins of interest.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">z</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">radius</span>:Number</code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code></td>
</tr>
</table>
</div>
<a name="getAllOutsideObjects()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getAllOutsideObjects</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getAllOutsideObjects(x:Number, y:Number, z:Number, radius:Number):Array</code><p>
    If the query region (sphere) extends outside of the "super-brick"
    we need to check for objects in the catch-all "other" bin which
     holds any object which are not inside the regular sub-bricks  
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">z</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">radius</span>:Number</code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code></td>
</tr>
</table>
</div>
<a name="getBinClientObjectList()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getBinClientObjectList</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getBinClientObjectList(bin:<a href="lqBin.html">lqBin</a>, x:Number, y:Number, z:Number, radiusSquared:Number):Array</code><p>  Given a bin's list of client proxies, traverse the list and invoke
     the given lqCallBackFunction on each object that falls within the
     search radius. 
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">bin</span>:<a href="lqBin.html">lqBin</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">z</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">radiusSquared</span>:Number</code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>Array</code></td>
</tr>
</table>
</div>
<a name="getMostPopulatedBin()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getMostPopulatedBin</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getMostPopulatedBin():<a href="../as3steer/lqBin.html">lqBin</a></code>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../as3steer/lqBin.html">lqBin</a></code></td>
</tr>
</table>
</div>
<a name="getMostPopulatedBinCenter()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">getMostPopulatedBinCenter</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function getMostPopulatedBinCenter():<a href="../as3steer/Vector3.html">Vector3</a></code>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../as3steer/Vector3.html">Vector3</a></code></td>
</tr>
</table>
</div>
<a name="lqAddToBin()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lqAddToBin</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function lqAddToBin(clientObject:<a href="lqClientProxy.html">lqClientProxy</a>, bin:<a href="lqBin.html">lqBin</a>):void</code><p> Adds a given client object to a given bin, linking it into the bin
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">clientObject</span>:<a href="lqClientProxy.html">lqClientProxy</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">bin</span>:<a href="lqBin.html">lqBin</a></code></td>
</tr>
</table>
</div>
<a name="lqBinCoordsToBinIndex()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lqBinCoordsToBinIndex</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function lqBinCoordsToBinIndex(ix:Number, iy:Number, iz:Number):int</code><p>
   Determine index into linear bin array given 3D bin indices 
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">ix</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">iy</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">iz</span>:Number</code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code>int</code></td>
</tr>
</table>
</div>
<a name="lqBinForLocation()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lqBinForLocation</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function lqBinForLocation(x:Number, y:Number, z:Number):<a href="../as3steer/lqBin.html">lqBin</a></code><p> Find the bin ID for a location in space.  The location is given in
          terms of its XYZ coordinates.  The bin ID is a pointer to a pointer
          to the bin contents list.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">z</span>:Number</code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../as3steer/lqBin.html">lqBin</a></code></td>
</tr>
</table>
</div>
<a name="lqFindNearestNeighborWithinRadius()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lqFindNearestNeighborWithinRadius</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function lqFindNearestNeighborWithinRadius(x:Number, y:Number, z:Number, radius:Number, ignoreObject:Object):<a href="../as3steer/lqClientProxy.html">lqClientProxy</a></code><p>
   Search the database to find the object whose key-point is nearest
          to a given location yet within a given radius.  That is, it finds
          the object (if any) within a given search sphere which is nearest
          to the sphere's center.  The ignoreObject argument can be used to
          exclude an object from consideration (or it can be NULL).  This is
          useful when looking for the nearest neighbor of an object in the
         ( database, since otherwise it would be its own nearest neighbor.
          The function returns a voidpointer to the nearest object, or
         NULL if none is found.
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">z</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">radius</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">ignoreObject</span>:Object</code></td>
</tr>
</table>
<p></p>
<span class="label">Returns</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20"></td><td><code><a href="../as3steer/lqClientProxy.html">lqClientProxy</a></code></td>
</tr>
</table>
</div>
<a name="lqRemoveAllObjects()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lqRemoveAllObjects</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function lqRemoveAllObjects():void</code><p> Removes (all proxies for) all objects from all bins
   </p></div>
<a name="lqRemoveAllObjectsInBin()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lqRemoveAllObjectsInBin</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function lqRemoveAllObjectsInBin(bin:<a href="lqBin.html">lqBin</a>):void</code><p>
   internal helper function
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">bin</span>:<a href="lqBin.html">lqBin</a></code></td>
</tr>
</table>
</div>
<a name="lqRemoveFromBin()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lqRemoveFromBin</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function lqRemoveFromBin(clientObject:<a href="lqClientProxy.html">lqClientProxy</a>):void</code><p> Removes a given client object from its current bin, unlinking it
    from the bin contents list. 
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">clientObject</span>:<a href="lqClientProxy.html">lqClientProxy</a></code></td>
</tr>
</table>
</div>
<a name="lqUpdateForNewLocation()"></a>
<table cellspacing="0" cellpadding="0" class="detailHeader">
<tr>
<td class="detailHeaderName">lqUpdateForNewLocation</td><td class="detailHeaderParens">()</td><td class="detailHeaderType">method</td><td class="detailHeaderRule">&nbsp;</td>
</tr>
</table>
<div class="detailBody">
<code>public function lqUpdateForNewLocation(clientObject:<a href="lqClientProxy.html">lqClientProxy</a>, x:Number, y:Number, z:Number):void</code><p>  Call for each client object every time its location changes.  For
     example, in an animation application, this would be called each
     frame for every moving object.  
   
   </p><span class="label">Parameters</span>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20px"></td><td><code><span class="label">clientObject</span>:<a href="lqClientProxy.html">lqClientProxy</a></code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">x</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">y</span>:Number</code></td>
</tr>
<tr>
<td class="paramSpacer">&nbsp;</td>
</tr>
<tr>
<td width="20px"></td><td><code><span class="label">z</span>:Number</code></td>
</tr>
</table>
</div>
<br>
<br>
<hr>
<br>
<p></p>
<center class="copyright"> 
</center>
</div>
</body>
</html>
<!-- -->
